package com.aaa.controller;

import com.aaa.entity.Orderform;
import com.aaa.service.impl.OrderformServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("order")
@Slf4j
public class OrderformController {

    @Resource
    OrderformServiceImpl orderformService;

    @RequestMapping("Oselect")
    @ResponseBody
    public List<Orderform> Oselect(String username){
        return orderformService.Oselect(username);
    }

    @RequestMapping("Odel")
    @ResponseBody
    public  int Odel(Integer orderid){
        return orderformService.Odel(orderid);
    }

    @RequestMapping("Oadd")
    @ResponseBody
    public int Oadd(Orderform orderform){
        return orderformService.Oadd(orderform);
    }

    @RequestMapping("Ostate")
    @ResponseBody
    public int Ostate(Integer orderid){
        return orderformService.Ostate(orderid);
    }

    @RequestMapping("payOrder")
    @ResponseBody
    public int payOrder(Integer orderid){
        return orderformService.payOrder(orderid);
    }
}
